home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2011 November
/
CHIP_2011_11.iso
/
Programy
/
Inne
/
Gry
/
Carnage_Contest
/
scripts
/
CC Original
/
tools
/
Cage.lua
< prev
next >
Wrap
Text File
|
2009-09-18
|
1KB
|
39 lines
--------------------------------------------------------------------------------
-- Weapon Cage
-- Original Carnage Contest Weapon
-- Script by DC, September 2009, www.UnrealSoftware.de
--------------------------------------------------------------------------------
-- Setup Tables
if cc==nil then cc={} end
cc.cage={}
-- Load & Prepare Ressources
cc.cage.gfx_wpn=loadgfx("buildings/cage.bmp") -- Weapon Image
setmidhandle(cc.cage.gfx_wpn)
cc.cage.sfx_build=loadsfx("buildmetal.ogg") -- Build Sound
--------------------------------------------------------------------------------
-- Weapon: Cage
--------------------------------------------------------------------------------
cc.cage.id=addweapon("cc.cage","Cage",cc.cage.gfx_wpn,0) -- Add Weapon (0 uses)
function cc.cage.draw() -- Draw
-- HUD Positioning
if weapon_shots==0 then
hudpositioning(pos_build,cc.cage.gfx_wpn,100,0,1)
end
end
function cc.cage.attack(attack) -- Attack
if (weapon_shots<=0) and (weapon_position==1) then
-- Use weapon and allow to use another one afterwards (1)
useweapon(1)
weapon_shots=weapon_shots+1
-- Draw
terrainimage(cc.cage.gfx_wpn,weapon_x,weapon_y)
-- Sound
playsound(cc.cage.sfx_build)
end
end